from django import template

register = template.Library()


@register.filter(name='indexof')
def indexof(item, items):
    return list(items).index(item)
